home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Various / S.N.A.G. Disk of the Month 90-07 (1990)(Southern Nevada Amiga Group)(PD).zip / S.N.A.G. Disk of the Month 90-07 (1990)(Southern Nevada Amiga Group)(PD).adf / Utilities / MMove! / MMove.c < prev    next >
C/C++ Source or Header  |  1990-06-21  |  1KB  |  61 lines

  1. #include <StdIO.h>
  2. #include <Intuition/IntuitionBase.h>
  3. #include <Intuition/Intuition.h>
  4.  
  5. struct IntuitionBase
  6.    *OpenLibrary();
  7.  
  8. struct IntuitionBase
  9.    *IntuitionBase = NULL;
  10.  
  11. main(Args, Coords)
  12. int
  13.    Args;
  14. char
  15.    *Coords[];
  16.    {
  17.       void
  18.          ShowUsage();
  19.  
  20.       short int
  21.          X,
  22.          Y;
  23.  
  24.       if (Args != 3)
  25.          ShowUsage();
  26.       else
  27.          {
  28.             X = atoi(Coords[1] );
  29.             Y = atoi(Coords[2] );
  30.  
  31.             if ( (X < 0) || (X > 639) || (Y < 0) || (Y > 399) )
  32.                ShowUsage();
  33.             else
  34.                {
  35.                   IntuitionBase = (struct IntuitionBase *)OpenLibrary(       \
  36.                    "intuition.library", LIBRARY_VERSION);
  37.  
  38.                   if (IntuitionBase != NULL)
  39.                      {
  40.                         IntuitionBase->MouseX = (long int)X;
  41.                         IntuitionBase->MouseY = (long int)Y;
  42.  
  43.                         ActivateWindow(IntuitionBase->ActiveWindow);
  44.  
  45.                         CloseLibrary(IntuitionBase);
  46.                      }
  47.                   else
  48.                      {
  49.                         printf("Error openning intuition.library.\n");
  50.                      }
  51.                }
  52.  
  53.          }
  54.    }
  55.  
  56. void ShowUsage()
  57.    {
  58.       printf("Proper usage is: MMove X Y.  ");
  59.       printf("Where X is 0 - 639 and Y is 0 - 399.\n");
  60.    }
  61.